Welcome to my gallery

Exploring HTML normal document flow

Prior to HTML5, HTML elements could be categorized as "block-level" or "inline-level." For the most part that's still true, although HTML5 created multiple element content categorizations such as Phrasing, Flow, and Sectioning that replace the more global block-level and inline-level categorization. Regardless, browsers still display content primarily using those two definitions. Most Phrasing content is displayed as inline-level elements while Heading and Sectioning content is displayed as block-level.

What does this mean? Well, block-level elements are typically formatted with a line break before and after the content; resulting in the content occupying it's own line on the page. Some block-level elements, like divs and the new HTML5 sectioning elements, can contain other block-level elements, while others like paragraphs and headings cannot.

Inline-level elements typically occur within another block-level element (although they don't have to) and generally contain either data or other inline-level elements. This content typically displays horizontally along the entire width of the viewport, only breaking down to a new line when the viewport width forces it to. Images, bold, italic, strong, emphasis, inputs, and links are all examples of inline-level elements.

How normal document flow works

Browsers display content in the order that it is found. Content at the top of the document, for example, is displayed first and is followed by the content after it. Block-level elements are displayed on their own line, while inline-level elements are displayed as part of the normal flow of document content. The results in the "stacking" of block-level blocks and the flow of inline-level elements within these blocks.